<template>
  <div>
    <p class="top">
      <span>预警通知</span>
      <span><el-button type="primary" @click="$router.back()">返回</el-button></span>
    </p>
    <div class="table-div">
      <p style="text-align:right;margin-bottom:20px"><el-button type="primary" plain>新增</el-button></p>
      <el-table
        :data="tableData"
        style="width: 100%"
        border
      >
        <el-table-column type="index" width="50" label="序号" align="center" />

        <el-table-column
          prop="name"
          label="名称"
          width="180"
        />
        <el-table-column
          prop="address"
          label="邮箱地址"
        />
        <el-table-column
          prop="address"
          label="接收范围"
        />
        <el-table-column width="200" label="操作" align="center">
          <template slot-scope="scope">
            <p @click="edit(scope.row)">移除</p>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <el-dialog
      title="编辑转换内容"
      center
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose"
    >
      <span>
        <el-input
          v-model="textarea"
          type="textarea"
          :rows="4"
          placeholder="请输入内容"
        />
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisible = false">保存</el-button>
      </span>
    </el-dialog>

  </div>
</template>
<script>
export default {
  data() {
    return {
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }],
      textarea: '',
      dialogVisible: false
    }
  },
  methods: {
    handleClose(done) {
      done()
    },
    edit(row) {
      this.dialogVisible = true
    }
  }
}
</script>
<style lang="scss" scoped>
.top{
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 80%;
  margin: auto;
  margin-top: 30px;
  margin-bottom: 30px;
}
.table-div{
  width: 80%;
  margin: auto;
}
</style>
